#ifndef __LOG_H__
#define __LOG_H__

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdarg>

#define MSG_MAX_LEN 4096

class Logger
{
public:
  static void error(const char* pattern, ...)
  {
    va_list ap;
    va_start(ap, pattern);
    bzero(msg_, MSG_MAX_LEN);
    vsnprintf(msg_, MSG_MAX_LEN - 1, pattern, ap);
    va_end(ap);

    std::cerr << msg_ << std::endl;
  }

private:
  static char msg_[MSG_MAX_LEN];
};

char Logger::msg_[MSG_MAX_LEN] = {0};


#endif
